/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package view;

import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.Form;
import javax.microedition.lcdui.Gauge;
import javax.microedition.lcdui.Item;
import javax.microedition.lcdui.Spacer;
import javax.microedition.lcdui.StringItem;

/**
 *
 * @author Victorino
 */
public class WaitForm extends Form implements AppForm {

    StringItem stringItm = new StringItem("", "");
    StringItem stringItm2 = new StringItem("", "");

    public WaitForm() {
        super(":: Aguarde ::");

        Spacer sp1 = new Spacer(10, 10);
        append(sp1);

        //append(AppHelper.getInstance().getMidlet().getImgWait());
        Spacer sp2 = new Spacer(10, 10);
        sp2.setLayout(Item.LAYOUT_CENTER);
        append(sp2);
        
        append(new Gauge("", false, Gauge.INDEFINITE, Gauge.CONTINUOUS_RUNNING));

        append(stringItm);
        Spacer sp3 = new Spacer(20, 30);
        append(sp3);
        sp3.setLayout(Item.LAYOUT_NEWLINE_AFTER);
//        stringItm2.setText("Essa operação irá\nimportar todos os\ndados da cidade\npara o seu celular...");
        
    }

    public Displayable getDisplyable() {
        return this;
    }

    public void initialize(Object parameter) {
        append(stringItm2);
        if (parameter instanceof String) {
            stringItm2.setText((String) parameter);
        }
    }

    public void setString(String str) {
        stringItm.setText(str);
    }
}
